From f9fbd371b1e16b3e52d6782c4e2f2651719e670b Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 26 Sep 2025 05:01:01 +0200 Subject: [PATCH] status/remoteAccess: Port to click gestures Part-of: --- js/ui/status/remoteAccess.js | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/js/ui/status/remoteAccess.js b/js/ui/status/remoteAccess.js index b7b70661e..99d7f9483 100644 --- a/js/ui/status/remoteAccess.js +++ b/js/ui/status/remoteAccess.js @@ -92,14 +92,12 @@ export const ScreenRecordingIndicator = GObject.registerClass({ Main.screenshotUI.connect( 'notify::screencast-in-progress', this._onScreencastInProgressChanged.bind(this)); - } - - vfunc_event(event) { - if (event.type() === Clutter.EventType.TOUCH_BEGIN || - event.type() === Clutter.EventType.BUTTON_PRESS) - Main.screenshotUI.stopScreencast(); - return Clutter.EVENT_PROPAGATE; + this._clickGesture = new Clutter.ClickGesture(); + this._clickGesture.set_recognize_on_press(true); + this._clickGesture.connect( + 'recognize', () => Main.screenshotUI.stopScreencast()); + this.add_action(this._clickGesture); } _updateLabel() { @@ -163,6 +161,11 @@ export const ScreenSharingIndicator = GObject.registerClass({ (o, handle) => this._onNewHandle(handle)); this._sync(); + + this._clickGesture = new Clutter.ClickGesture(); + this._clickGesture.set_recognize_on_press(true); + this._clickGesture.connect('recognize', () => this._stopSharing()); + this.add_action(this._clickGesture); } _onNewHandle(handle) { @@ -184,14 +187,6 @@ export const ScreenSharingIndicator = GObject.registerClass({ this._sync(); } - vfunc_event(event) { - if (event.type() === Clutter.EventType.TOUCH_BEGIN || - event.type() === Clutter.EventType.BUTTON_PRESS) - this._stopSharing(); - - return Clutter.EVENT_PROPAGATE; - } - _stopSharing() { for (const handle of this._handles) handle.stop(); -- 2.39.5